package com.ocom.company.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.common.entity.card.EntityXfDeviceInfo;
import com.ocom.common.enums.DataSourceEnum;
import com.ocom.common.enums.MasterSlaveEnum;
import com.ocom.common.vo.company.MachCountVo;
import com.ocom.company.dao.IDaoXfDeviceInfo;
import com.ocom.company.service.XfDeviceInfoService;
import com.ocom.mysql.aspect.DataSourceAspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class XfDeviceInfoServiceImpl extends ServiceImpl<IDaoXfDeviceInfo, EntityXfDeviceInfo> implements XfDeviceInfoService {

	@Autowired
	private IDaoXfDeviceInfo xfDeviceInfo;




	@Override
	@DataSourceAspect(type= DataSourceEnum.PART_DB,isMaster = MasterSlaveEnum.SLAVE)
	public List<MachCountVo> selectMachCount(Long companyId) {
		return xfDeviceInfo.selectMachCount();
	}

	@Override
	@DataSourceAspect(type= DataSourceEnum.PART_DB,isMaster = MasterSlaveEnum.SLAVE)
	public Integer selectCount(Long companyId) {
		QueryWrapper<EntityXfDeviceInfo> queryWrapper=new QueryWrapper<>();
		return this.count(queryWrapper);
	}
}
